package main

import "fmt"

type Prototype interface {
	Call()
}

type Implement struct {
	Name string
}

func (i *Implement) Call() {
	fmt.Printf("call %v\n", i.Name)
}

type reader interface {
	Read() string
}

type writer interface {
	Write(data any)
}

type Buffer string

var cache string

func (b *Buffer) Read() string {
	return cache
}

func (b *Buffer) Write(data any) {
	cache = fmt.Sprint(data)
}

func main() {
	var p Prototype
	p = &Implement{"module"}
	p.Call()
	var buf Buffer
	buf.Write("hello")
	fmt.Println(buf.Read())
}
